package com.lucy.common.converter;

import com.lucy.common.utils.JsonUtil;

import javax.persistence.AttributeConverter;

/**
 * @author kindear
 * @Desc : JSON LIST 数据转换器
 */
@Deprecated
public class JpaListStringConverter implements AttributeConverter<Object,String> {
    @Override
    public String convertToDatabaseColumn(Object o) {
        return JsonUtil.obj2String(o);
    }

    @Override
    public Object convertToEntityAttribute(String s) {
        return JsonUtil.string2Obj(s,Object.class);
    }
}
